package com.itany.corejava.code07_面向对象.抽象类与接口;

/**
 * @author 石小俊
 * @date 2023年04月20日 11:15
 */
public class Test01_抽象类 {
    public static void main(String[] args) {
//        Person person = new Person();
        Person man = new Man("张三", 8000.0);
//        Person woMan = new WoMan();
    }
}

abstract class Person {
    private String name;

    public Person() {
        System.out.println("这是无参构造方法");
    }

    public Person(String name) {
        this.name = name;
    }

    public abstract void show();

    public void print() {
        System.out.println("这是抽象类中的普通方法");
    }
}

class Man extends Person {
    private double salary;

    public Man(String name, double salary) {
        super(name);
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public void show() {
        System.out.println("我是一个男人");
    }
}

abstract class WoMan extends Person {
}